import java.util.EventListener;
import java.util.EventObject;

import javax.swing.event.EventListenerList;

/*
 * Developed: Thomas Georg
 */


public class global_values {

	private boolean running=false;
	 boolean stop=false;
	private javax.swing.JButton gobutton;
	private javax.swing.JLabel remaining_time;
	private javax.swing.JProgressBar jProgressBar1;
	private String filename=("teatimer-v019.jar");
	private String Version="V1.20";
	private int durchlaufszaehler=0;
	private long zeitwert=0;
	private long deadline=0;
	private long starttime=0;

	private EventListenerList listeners = new EventListenerList();

	public long getDeadline() {
		return deadline;
	}

	public void setDeadline(long deadline) {
		this.deadline = deadline;
	}

	public int getDurchlaufszaehler() {
		return durchlaufszaehler;
	}

	public void setDurchlaufszaehler(int durchlaufszaehler) {
		this.durchlaufszaehler = durchlaufszaehler;
		notifyAdvertisement( new changeEvent(this,durchlaufszaehler) ); 

	}

	public void setDurchlaufszaehler_puls_1()
	{
		durchlaufszaehler++;
		notifyAdvertisement( new changeEvent(this,durchlaufszaehler) ); 
	}

	public boolean isRunning() {
		return running;
	}

	public void setRunning(boolean running) {
		this.running = running;
	}

	public javax.swing.JButton getGobutton() {
		return gobutton;
	}
	public void setGobutton(javax.swing.JButton gobutton) {
		this.gobutton = gobutton;
	}
	public javax.swing.JLabel getRemaining_time() {
		return remaining_time;
	}
	public void setRemaining_time(javax.swing.JLabel remaining_time) {
		this.remaining_time = remaining_time;
	}
	public javax.swing.JProgressBar getJProgressBar1() {
		return jProgressBar1;
	}
	public void setJProgressBar1(javax.swing.JProgressBar progressBar1) {
		jProgressBar1 = progressBar1;
	}
	public String getFilename() {
		return filename;
	}
	public void setFilename(String filename) {
		this.filename = filename;
	}

	public String getVersion() {
		return Version;
	}

	public void setVersion(String version) {
		Version = version;
	}

	protected synchronized void notifyAdvertisement( changeEvent event ) 
	{ 
		for ( changelistener l : listeners.getListeners( changelistener.class ) ) 
			l.changeevent(event); 

	} 

	public void addAdListener( changelistener listener ) 
	{ 
		System.out.println("ADD");
		listeners.add( changelistener.class, listener ); 
	} 

	public void removeListener( changelistener listener ) 
	{ 
		listeners.remove( changelistener.class, listener ); 

	} 

	public void removeallListener( ) 
	{ 
		listeners=new EventListenerList(); 
	}

	public EventListenerList getListeners() {
		return listeners;
	}

	public void setListeners(EventListenerList listeners) {
		this.listeners = listeners;
	}

	public boolean isStop() {
		return stop;
	}

	public void setStop(boolean stop) {
		this.stop = stop;
	}

	public long getZeitwert() {
		return zeitwert;
	}

	public void setZeitwert(long zeitwert) {
		this.zeitwert = zeitwert;
	}

	public long getStarttime() {
		return starttime;
	}

	public void setStarttime(long starttime) {
		this.starttime = starttime;
	} 
}


interface changelistener extends EventListener 
{ 
	/** Invoked when an ad occurs. */ 
	void changeevent( changeEvent event );
}


class changeEvent extends EventObject 
{ 

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private int slogan; 

	public changeEvent( Object source, int slogan ) 
	{ 
		super( source ); 
		this.slogan = slogan; 
	} 

	public int getSlogan() 
	{ 
		return slogan; 
	} 
}